package com.jeespring.aop.dynamicproxy.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @description MethodInterceptorImpl
 * @author 张朝阳
 * @date 2021/4/8 18:15
 */
public class MethodInterceptorImpl implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("代理前执行");
        Object result = methodProxy.invokeSuper(o, objects);
        System.out.println("代理后执行");
        return result;
    }
}
